#define PCB_STACK_SIZE 1240
#define PCB_NAME_SIZE 32
#define READY 1
#define SUSPENDED_READY 2
#define BLOCKED 3
#define SUSPENDED_BLOCKED 4
#define APPLICATION 0
#define SYSTEM 1
#define SYS_STACK_SIZE 4000

#define BUFFER_SIZE 200
#define DEFAULT_DIRECTORY "."
#define DISPLAY_AT_A_TIME 2
#define MAX_ARGS 20
#define NUM_FUNCTIONS 23
#define COMMAND_LENGTH 25
#define RUNNING 1

void interrupt sys_call ();

typedef struct context {

	unsigned int BP, DI, SI, DS, ES;
	unsigned int DX, CX, BX, AX;
	unsigned int IP, CS, FLAGS;

} context;

typedef struct params{

	int op_code; //operation code, IDLE, EXIT, READ, WRITE, etc
	int device_id; //TERMINAL, COM_PORT
	unsigned char *buf_addr; //buffer address
	int *count_addr; //size of the buffer

} params;

struct process_control_block {
	
	char name[PCB_NAME_SIZE];	
	int memory_size, priority, state, class;
	unsigned char *stack_top, *stack_base, *execute, *load;

};

struct priority_queue_node{
	struct priority_queue_node *left;
	struct priority_queue_node *right;
	struct process_control_block *data;
};

struct priority_queue {
	int length;
	struct priority_queue_node *head;
	struct priority_queue_node *tail;
};

typedef struct process_control_block pcb;
typedef struct process_control_block *ppcb;
typedef struct priority_queue pq;
typedef struct priority_queue *ppq;
typedef struct priority_queue_node pqn;
typedef struct priority_queue_node *ppqn;

typedef struct iod {

	char *name;
	ppcb process;
	int request_type;
	char *buffer;
	int *count;
	struct iod *next;

}iod;

typedef struct iocb {

	int event_flag;
	int count;
	struct iod *head;
	struct iod *tail;
	
}iocb;
